#!/bin/bash
# TEST SUITE 3
# Set-up: 1 middle man with 3 queues, 3 postgresql server
# Purpose: Try to measure the performances of the system with three databases and 1 middle-man


# CONFIGURATION BEGINS HERE

# the folder where results should be stored (relative to home)
results_folder='mockup_1m_3s'

middle_man_host='dryad12.inf.ethz.ch'
db_host1='dryad13.inf.ethz.ch'
db_host2='dryad14.inf.ethz.ch'
db_host3='dryad15.inf.ethz.ch'
#duration in minutes
duration=1




# AUTOMATIC ITERATION BEGINS HERE
if [ ! -d $results_folder ]; then
	mkdir $results_folder
fi
L=100
P=3

for C in 1 #8 16 32 48 64 96
do
	for M in 6 #12
	do
		out_file_path="$results_folder/c"$C"_p"$P"_l"$L"_m"$M".raw"
		if [ ! -f $out_file_path ]; then
			middle_man_config="{{middle_man:$middle_man_host};{{P:$P},{L:$L},{M:$M},{database:$db_host1},{database:$db_host2},{database:$db_host3}}}"
			args="$C $duration $out_file_path 1 $middle_man_config"
			./client.sh $args
		fi
	done
done